//delete[]

#include <iostream>
using namespace std;

class A{
  int aa;
public:
  A(){ cout<<"A()" <<endl;}
  ~A(){cout<<"~A()"<<endl;} //virtual?
};

class B :public A{
  int bb;
public:
  B(){ cout<<"B()" <<endl;}
  ~B(){cout<<"~B()"<<endl;}
};
 
int main()
{
  B* bptr = new B[3];
  cout<<"-------delete---------"<<endl;
  delete[] bptr;

  cout<<"----------------------"<<endl;
  A* aptr = new B[3];
  cout<<"-------delete---------"<<endl;
  delete[] aptr;
}
